class CreateDocumentVersions < ActiveRecord::Migration
  def self.up
    create_table :document_versions  do |t|
      t.string  :version_file_name, :null => false
      t.string  :version_content_type, :null => false
      t.integer :version_file_size, :null => false
      t.integer :version_number, :default => 1
      t.userstamps
      t.timestamps
    end
    add_foreign_key :document_versions, :documents
  end

  def self.down
    remove_foreign_key :document_versions, :documents
    drop_table :documents
  end
end
